import React from 'react';
import { Tooltip } from 'antd';
import MyIcon from '@/components/MyIcon';
import styles from './index.less';

const TooltipIcon = ({
  title,
  placement = 'top',
  icon,
  width = '-30px',
  fontSize = 28,
  top = '0',
  ...rest
}) => {
  return (
    <Tooltip title={title} placement={placement}>
      <div className={styles.icon} {...rest} style={{ left: width, top }}>
        <MyIcon type={icon} style={{ fontSize }} />
      </div>
    </Tooltip>
  );
};

export default TooltipIcon;
